<?php
namespace app\common\model;
use \think\Model;
class Order extends BaseModel{
    protected $autoWriteTimestamp=true;
    public function add($data){
        $data['status']=1;
        $this->save($data);
        return  $this->id;
    }
    // 取出所有的订单
    public function getNormalAllOrders(){
        $data=[
           'status'=>1,
        ];
        //排序
        $order=[
            'id'=>"desc",
        ];
        
        $result=$this->where($data)
                ->order($order)
                ->select();
        return $result;
    }
    //取出所查询的所有信息
    
    public function getNormalOrders($data=[]){
               $data['status']=1;
               $order=['id'=>'desc'];
               $result=$this->where($data)
                       ->order($order)
                       ->select();
               return $result;
               
    }
    
    
    
}

